<h1><%=h "Listing users".t %></h1>

<table class="index-table">
  <% for user in @users %>
    <tr>
      <td><%=h user.login %></td> 
    
      <% if user.is_admin? %>
    		<td><%= translate_safely("Admin") -%></td>
    	<% else %>
    	  <td><%= translate_safely("User") -%></td>
    	  <td><%= link_to h("Delete".t), user, :confirm => h("Are you sure?".t), :method => :delete %></td>
    	<% end %>
  	
    	<% if !user.is_approved? %>
    		<td><%= link_to h("Approve".t), { :action => "approve", :id => user.id, :controller => 'users' } %></td>
    	<% else %>
        <td></td>
    	<% end %>

    </tr>
  <% end %>
</table>
